package javabook.ch05;
class SW2{
	
	public static int x, y;
	
	public static void sw2(SW2 boo){
		int temp;
		temp = x;
		x = y;
		y = temp;
		System.out.println("swp : new x = " + x + ", new y = " + boo.y);
	}
}
public class Jv_5_5 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//객체를 생성...
		//객체.x = 3;
		//sw1.객체(객체.x, 객체. y)
		SW2 sw1 = new SW2();
		sw1.x = 20;
		sw1.y = 50;
		System.out.println("old x = " + sw1.x + ", old y = " + sw1.y);
		SW2.sw2(sw1);
		System.out.println("new x = " + sw1.x + ", new y = " + sw1.y);
	}
}

